<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTicketsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tickets', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->integer('business_id')->unsigned();
            $table->integer('user_id')->unsigned();
            $table->string('title')->nullable();
            $table->integer('type')->unsigned();
            $table->integer('total')->unsigned();
            $table->integer('price')->unsigned();
            $table->dateTime('start_date');
            $table->dateTime('expire_date');
            $table->dateTime('create_date');
            $table->dateTime('update_date');
            $table->integer('state')->default(0);
            $table->string('remark')->nullable();
            $table->string('picture');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tickets');
    }
}
